import React, { Component } from "react";
import {
    Layout, Menu, Icon, Table, Divider, Button, Modal, Form, Input, DatePicker, Upload,
    Select, Popconfirm, message, Alert, TreeSelect, TimePicker, Tree,
    AutoComplete, Tabs, Col, Row, Dropdown, Card, Pagination, Spin, Skeleton,
    Drawer, Tag, Tooltip, Badge, Radio, Steps, Transfer, notification, Empty, Calendar, Checkbox, Switch
} from "antd";
import { compareSecretAndExpireTimeApi } from "../js/api.js";
// import reqwest from 'reqwest';

class TestScreen extends Component {
    constructor(props) {
        super(props);
        this.state = {
            secret: this.props.match.params.secret,
            isShow: false
        };
    }

    componentWillMount() {
      console.log("即将渲染-------", this.state.secret)
    }

    componentDidMount() {
        compareSecretAndExpireTimeApi(this.state.secret).then((res) =>{
            console.log(res.data)
            if(res.data == 'success'){
                this.setState({
                    isShow : true 
                })
            }
        })
    }

    render() {
        
        return (
            <div>
                {
                    this.state.isShow ? 
                    <div>
                         asdasdasdasdasd
                    </div>
                    :null
                }
            </div>
        )
    }
}



export default TestScreen
